﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A65枚举转换
{
    class Program
    {
        static void Main(string[] args)
        {
            //枚举项转整数
           int i= (int)  WeekDay.Sun;
            Console.WriteLine(i);

            //整数转枚举项
            WeekDay day = (WeekDay)3;
            Console.WriteLine(day);

            //枚举项转字符串
            string str = WeekDay.Thu.ToString();
            Console.WriteLine(str);

            //字符串转枚举项
            string str1 = "Mon";
           WeekDay day1=   (WeekDay) Enum.Parse(typeof(WeekDay),str1);
        }
    }
}
